package com.boilermaker.lotterysystem.service.dto;

import com.boilermaker.lotterysystem.service.enums.ActivityPrizeStatusEnum;
import com.boilermaker.lotterysystem.service.enums.ActivityPrizeTiersEnum;
import com.boilermaker.lotterysystem.service.enums.ActivityStatusEnum;
import com.boilermaker.lotterysystem.service.enums.ActivityUserStatusEnum;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@Data
public class ActivityDetailDTO {

    private Long activityId;

    private String activityName;

    private String desc;

    private ActivityStatusEnum status;

    public Boolean valid() {
        return status.equals(ActivityStatusEnum.RUNNING);
    }

    private List<ActivityPrizeDTO> prizeDTOList;

    private List<ActivityUserDTO> userDTOList;

    @Data
    public static class ActivityPrizeDTO {

        private Long prizeId;

        private String name;

        private String imageUrl;

        private BigDecimal price;

        private String description;

        private ActivityPrizeTiersEnum tiers;

        private Long prizeAmount;

        private ActivityPrizeStatusEnum status;

        public Boolean valid() {
            return status.equals(ActivityPrizeStatusEnum.AVAILABLE);
        }
    }

    @Data
    public static class ActivityUserDTO {

        private Long userId;

        private String userName;

        private ActivityUserStatusEnum status;

        public Boolean valid() {
            return status.equals(ActivityUserStatusEnum.AVAILABLE);
        }
    }
}
